<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>QCNSim: QcnSim/Scheduler.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">QCNSim
   </div>
   <div id="projectbrief">Simulator for Quake-Catcher Network</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d21be12960473ba5c51e5f9beea3525e.html">QcnSim</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Scheduler.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_scheduler_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_scheduler_8h.html">Scheduler.h</a>&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="class_scheduler.html#a69f30fe77aaaeb4e4945e09e0960a16a">   31</a></span>&#160;<a class="code" href="class_scheduler.html#a69f30fe77aaaeb4e4945e09e0960a16a">Scheduler::Scheduler</a>(<a class="code" href="class_simulator_globals.html">SimulatorGlobals</a> &amp;simulatorGlobals, <span class="keyword">const</span> <a class="code" href="class_event.html">Event</a> &amp;event): simulatorGlobals(simulatorGlobals) {</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="comment">// This is the first event, so just add it to the heap.</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <a class="code" href="class_scheduler.html#ae84f19f548d606f50fba69d00fe691b1">schedule</a>(event);</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;}</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="class_scheduler.html#aa519123dc50cd9b23c8991f23662f02c">   44</a></span>&#160;<a class="code" href="class_scheduler.html#a69f30fe77aaaeb4e4945e09e0960a16a">Scheduler::Scheduler</a>(<a class="code" href="class_simulator_globals.html">SimulatorGlobals</a> &amp;simulatorGlobals): simulatorGlobals(simulatorGlobals) {</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;}</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="class_scheduler.html#ae84f19f548d606f50fba69d00fe691b1">   56</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_scheduler.html#ae84f19f548d606f50fba69d00fe691b1">Scheduler::schedule</a>(<span class="keyword">const</span> <a class="code" href="class_event.html">Event</a> &amp;event) {</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="comment">// Search for insertion point within the event chain, i.e., look for event (in event chain) just after new event to be inserted.</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="keywordtype">double</span> eventTime = <a class="code" href="class_scheduler.html#ae80517b2251b2352732ca0740b7bbb64">simulatorGlobals</a>.<a class="code" href="class_simulator_globals.html#a08da82e86d7c26d8f2498bd313f0e66e">getCurrentAbsoluteTime</a>() + <span class="keyword">event</span>.occurAfterTime; <span class="comment">// Absolute occurrence time</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    std::list&lt;EventChainElement&gt;::iterator eventChainIterator = <a class="code" href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">eventChain</a>.begin();</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keywordflow">while</span> (eventChainIterator != <a class="code" href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">eventChain</a>.end()) {</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <span class="keywordflow">if</span> (eventChainIterator-&gt;eventTime &lt;= eventTime) { <span class="comment">// Looking for event with eventTime *after* the new event to insert</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;            ++eventChainIterator;</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;            <span class="comment">// Found next event after new event to be inserted. Insert new event before.</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;            <a class="code" href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">eventChain</a>.insert(eventChainIterator, <a class="code" href="class_event_chain_element.html">EventChainElement</a>(eventTime, event)); <span class="comment">// Insert element (new EventChainElement with copy of event).</span></div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;            <span class="keywordflow">return</span>; <span class="comment">// Done.</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        }</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    }</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="comment">// Can only reach this point if end of event chain was reached, i.e., the new event must be inserted at the end of event chain.</span></div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <a class="code" href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">eventChain</a>.push_back(<a class="code" href="class_event_chain_element.html">EventChainElement</a>(eventTime, event));</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;}</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="class_scheduler.html#a2efbb6f69464273b3ef92953d91018c9">   83</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_scheduler.html#a2efbb6f69464273b3ef92953d91018c9">Scheduler::scheduleFront</a>(<span class="keyword">const</span> <a class="code" href="class_event.html">Event</a> &amp;event) {</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <a class="code" href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">eventChain</a>.push_front(<a class="code" href="class_event_chain_element.html">EventChainElement</a>(<a class="code" href="class_scheduler.html#ae80517b2251b2352732ca0740b7bbb64">simulatorGlobals</a>.<a class="code" href="class_simulator_globals.html#a08da82e86d7c26d8f2498bd313f0e66e">getCurrentAbsoluteTime</a>(), event));</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;}</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="class_scheduler.html#a501e5da3b8dc453b331702aa06066eb4">   95</a></span>&#160;<a class="code" href="class_event.html">Event</a> <a class="code" href="class_scheduler.html#a501e5da3b8dc453b331702aa06066eb4">Scheduler::cause</a>() {</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;        <a class="code" href="class_scheduler.html#ae80517b2251b2352732ca0740b7bbb64">simulatorGlobals</a>.<a class="code" href="class_simulator_globals.html#a29e97c64b5f7afad0523482d23f64728">setCurrentAbsoluteTime</a>((<a class="code" href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">eventChain</a>.begin())-&gt;eventTime); <span class="comment">// Sets currentAbsoluteTime to first event&#39;s eventTime (advances or jumps the clock).</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;        <span class="comment">// Removes and returns the first event.</span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        <a class="code" href="class_event.html">Event</a> nextEvent = <a class="code" href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">eventChain</a>.front().event;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        <a class="code" href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">eventChain</a>.pop_front();</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        <span class="keywordflow">return</span> nextEvent; </div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    }</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keywordflow">catch</span> (<span class="keywordtype">int</span> e) {</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        <span class="comment">// Empty Event Chain.  Should not happen... should always have at least an END_SIMULATION event.</span></div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        std::cout &lt;&lt; <span class="stringliteral">&quot;Event Chain is empty.  No more events to process, ending simulation...&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        exit(e);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        <span class="comment">//return nullptr;</span></div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;}</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div>
<div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="class_scheduler.html#ac09d9f9b4147c949268fa6bc66ced974">  117</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_scheduler.html#ac09d9f9b4147c949268fa6bc66ced974">Scheduler::removeEvents</a>(std::shared_ptr&lt;const Entity&gt; entity) {</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="comment">// Find all eventChainElements in which Events contain Entity object, and remove them all.</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> removedEventsCounter = 0; <span class="comment">// How many events were removed?</span></div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="comment">// Using the regular iterator loop instead of C++11 foreach, since we need the iterator to remove elements anyway (or be forced to search</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="comment">// the list one more time to remove by value.</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <span class="comment">// This will actually not work, since, when removing an element, the loop iterator pointing to it will be invalidated. Therefore,</span></div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="comment">// cannot be incremented. See http://stackoverflow.com/questions/596162/can-you-remove-elements-from-a-stdlist-while-iterating-through-it.</span></div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="comment">//for (std::list&lt;EventChainElement&gt;::iterator eventIterator = eventChain.begin(); eventIterator != eventChain.end(); ++eventIterator) {</span></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="comment">//  if (eventIterator-&gt;event.entity == entity) {</span></div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="comment">//      // Found event with matching Entity: remove.</span></div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="comment">//      eventChain.erase(eventIterator);</span></div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="comment">//      ++removedEventsCounter; // Increment removed events counter.</span></div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <span class="comment">//  }</span></div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="comment">//}</span></div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    std::list&lt;EventChainElement&gt;::iterator eventIterator = <a class="code" href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">eventChain</a>.begin();</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keywordflow">while</span> (eventIterator != <a class="code" href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">eventChain</a>.end()) {</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        <span class="comment">// If this event has the specified Entity object, then remove it.</span></div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        <span class="keywordflow">if</span> (eventIterator-&gt;event.entity == entity) {</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;            eventIterator = <a class="code" href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">eventChain</a>.erase(eventIterator); <span class="comment">/* Looks weird? Check http://stackoverflow.com/questions/596162/can-you-remove-elements-from-a-stdlist-while-iterating-through-it.</span></div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="comment">                                                              * Notice that erase deletes the element at eventIterator, and returns the iterator to the *next* element. eventIterator has to</span></div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="comment">                                                              * has to point to this next element, otherwise it will point to a no-longer existing element.</span></div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;<span class="comment">                                                              */</span></div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;            ++removedEventsCounter; <span class="comment">// Increment removed events counter.</span></div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;            ++eventIterator;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;        }</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    }</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="keywordflow">return</span> removedEventsCounter;</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;}</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div>
<div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="class_scheduler.html#a49d6d8bc35ca5e24d637a45e63cdd8e3">  152</a></span>&#160;std::list&lt;EventChainElement&gt;::size_type <a class="code" href="class_scheduler.html#a49d6d8bc35ca5e24d637a45e63cdd8e3">Scheduler::getChainSize</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">eventChain</a>.size();</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;}</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div>
<div class="ttc" id="class_scheduler_html_ae80517b2251b2352732ca0740b7bbb64"><div class="ttname"><a href="class_scheduler.html#ae80517b2251b2352732ca0740b7bbb64">Scheduler::simulatorGlobals</a></div><div class="ttdeci">SimulatorGlobals &amp; simulatorGlobals</div><div class="ttdoc">Reference to SimulatorGlobals object, to control simulation clock time and etc. </div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8h_source.html#l00066">Scheduler.h:66</a></div></div>
<div class="ttc" id="class_event_chain_element_html"><div class="ttname"><a href="class_event_chain_element.html">EventChainElement</a></div><div class="ttdoc">Defines an element for the Event Chain. </div><div class="ttdef"><b>Definition:</b> <a href="_event_chain_element_8h_source.html#l00036">EventChainElement.h:36</a></div></div>
<div class="ttc" id="class_event_html"><div class="ttname"><a href="class_event.html">Event</a></div><div class="ttdoc">Event class. </div><div class="ttdef"><b>Definition:</b> <a href="_event_8h_source.html#l00035">Event.h:35</a></div></div>
<div class="ttc" id="class_scheduler_html_ac09d9f9b4147c949268fa6bc66ced974"><div class="ttname"><a href="class_scheduler.html#ac09d9f9b4147c949268fa6bc66ced974">Scheduler::removeEvents</a></div><div class="ttdeci">unsigned int removeEvents(std::shared_ptr&lt; const Entity &gt; entity)</div><div class="ttdoc">Removes events from Event Chain that contains a matching entity in the Event object. </div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8cpp_source.html#l00117">Scheduler.cpp:117</a></div></div>
<div class="ttc" id="class_simulator_globals_html_a08da82e86d7c26d8f2498bd313f0e66e"><div class="ttname"><a href="class_simulator_globals.html#a08da82e86d7c26d8f2498bd313f0e66e">SimulatorGlobals::getCurrentAbsoluteTime</a></div><div class="ttdeci">double getCurrentAbsoluteTime() const </div><div class="ttdef"><b>Definition:</b> <a href="_simulator_globals_8cpp_source.html#l00070">SimulatorGlobals.cpp:70</a></div></div>
<div class="ttc" id="class_scheduler_html_ae84f19f548d606f50fba69d00fe691b1"><div class="ttname"><a href="class_scheduler.html#ae84f19f548d606f50fba69d00fe691b1">Scheduler::schedule</a></div><div class="ttdeci">void schedule(const Event &amp;event)</div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8cpp_source.html#l00056">Scheduler.cpp:56</a></div></div>
<div class="ttc" id="_scheduler_8h_html"><div class="ttname"><a href="_scheduler_8h.html">Scheduler.h</a></div></div>
<div class="ttc" id="class_simulator_globals_html"><div class="ttname"><a href="class_simulator_globals.html">SimulatorGlobals</a></div><div class="ttdoc">Simulator-scope variables and parameters. </div><div class="ttdef"><b>Definition:</b> <a href="_simulator_globals_8h_source.html#l00159">SimulatorGlobals.h:159</a></div></div>
<div class="ttc" id="class_scheduler_html_af6ecb496c89f25f9a303dfd3b720f7cd"><div class="ttname"><a href="class_scheduler.html#af6ecb496c89f25f9a303dfd3b720f7cd">Scheduler::eventChain</a></div><div class="ttdeci">std::list&lt; EventChainElement &gt; eventChain</div><div class="ttdoc">The Event Chain as a min-heap ordered by eventTime. Underlying container is a list, and this class should maintain heap order. </div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8h_source.html#l00065">Scheduler.h:65</a></div></div>
<div class="ttc" id="class_scheduler_html_a49d6d8bc35ca5e24d637a45e63cdd8e3"><div class="ttname"><a href="class_scheduler.html#a49d6d8bc35ca5e24d637a45e63cdd8e3">Scheduler::getChainSize</a></div><div class="ttdeci">std::list&lt; EventChainElement &gt;::size_type getChainSize() const </div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8cpp_source.html#l00152">Scheduler.cpp:152</a></div></div>
<div class="ttc" id="class_scheduler_html_a69f30fe77aaaeb4e4945e09e0960a16a"><div class="ttname"><a href="class_scheduler.html#a69f30fe77aaaeb4e4945e09e0960a16a">Scheduler::Scheduler</a></div><div class="ttdeci">Scheduler(SimulatorGlobals &amp;simulatorGlobals, const Event &amp;event)</div><div class="ttdoc">Constructor with initial event. </div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8cpp_source.html#l00031">Scheduler.cpp:31</a></div></div>
<div class="ttc" id="class_scheduler_html_a2efbb6f69464273b3ef92953d91018c9"><div class="ttname"><a href="class_scheduler.html#a2efbb6f69464273b3ef92953d91018c9">Scheduler::scheduleFront</a></div><div class="ttdeci">void scheduleFront(const Event &amp;event)</div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8cpp_source.html#l00083">Scheduler.cpp:83</a></div></div>
<div class="ttc" id="class_simulator_globals_html_a29e97c64b5f7afad0523482d23f64728"><div class="ttname"><a href="class_simulator_globals.html#a29e97c64b5f7afad0523482d23f64728">SimulatorGlobals::setCurrentAbsoluteTime</a></div><div class="ttdeci">void setCurrentAbsoluteTime(double currentAbsoluteTime)</div><div class="ttdef"><b>Definition:</b> <a href="_simulator_globals_8cpp_source.html#l00159">SimulatorGlobals.cpp:159</a></div></div>
<div class="ttc" id="class_scheduler_html_a501e5da3b8dc453b331702aa06066eb4"><div class="ttname"><a href="class_scheduler.html#a501e5da3b8dc453b331702aa06066eb4">Scheduler::cause</a></div><div class="ttdeci">Event cause()</div><div class="ttdef"><b>Definition:</b> <a href="_scheduler_8cpp_source.html#l00095">Scheduler.cpp:95</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 15 2014 10:33:13 for QCNSim by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
